﻿using Apps.Common;
using Apps.IBLL.RC;
using Apps.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Apps.BLL.RC
{
    public partial class RC_UPLOADINGBLL : IRC_UPLOADINGBLL
    {
        public List<V_RC_UPLOADING> QueryUploadingList(ref GridPager pager, Expression<Func<V_RC_UPLOADING, bool>> whereLambda)
        {
            using (DBContainer db = new DBContainer())
            {
                IQueryable<V_RC_UPLOADING> queryData = db.V_RC_UPLOADING.AsQueryable<V_RC_UPLOADING>();
                queryData = queryData.Where(whereLambda.Compile()).AsQueryable();

                pager.totalRows = queryData.Count();
                queryData = LinqHelper.SortingAndPaging(queryData, pager.sort, pager.order, pager.page, pager.rows);
                
                return queryData.ToList();
            }
        }
    }
}
